<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="" th:action="${sansan==null}?@{/addStudent}:@{uptStudent}">
    <table border="1">
        <input type="hidden" name="id" th:value="${sansan!=null}?${sansan.id}">
        <div class="form-group">
        <label>姓名</label>
                <input type="text" name="name" th:value="${sansan!=null}?${sansan.name}">
       </div>
        <div class="form-group">
            <label>性别</label><br/>
                <input class="form-check-input" type="radio" name="sex" value="男"
                       th:checked="${sansan!=null}?${sansan.sex==1}">男
                <input class="form-check-input" type="radio" name="sex" value="女"
                       th:checked="${sansan!=null}?${sansan.sex==0}">女
        </div>
        <div class="form-group">
            <label>年级</label>
            <select class="form-control" name="gradeId">
                <option value="1" th:href="${sansan!=null}?${sansan.gradeId}">S1</option>
                <option value="2" th:href="${sansan!=null}?${sansan.gradeId}">S2</option>
                <option value="3" th:href="${sansan!=null}?${sansan.gradeId}">Y2</option>
            </select>
        </div>
        <input type="submit" value="提交">
    </table>
</form>
</body>
</html>